<template>
    <div>
        <table>
            <thead>
                <tr>
                    <th>序号</th>
                    <th>姓名</th>
                    <th>年龄</th>
                    <th>头像</th>
                </tr>
            </thead>
            <tbody>
                <tr v-for="(item,index) in list" :key="index">
                    <td>{{index+1}}</td>
                    <td>{{item.name}}</td>
                    <td>{{item.age}}</td>
                    <td>
                        <slot name="portrait" :imgSrc="item.headImgUrl"></slot>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script>
export default {
    props:["list"]
}
</script>

<style scoped>
table{
    border: 1px solid #000;
    width: 500px;
}
th,td{
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    padding: 5px;
}
</style>